<!-- 我的页面 -->
<template>
	<view class="page-index">
		<view class="info-box">
			<view class="info-top-box">
				<view class="photo">
					<image :src="userInfoS.tx" mode=""></image>
				</view>
				<view class="info-text">
					<view class="name">
						{{userInfoS.username || '微信用户'}}
					</view>
					<view class="addres">
						{{userInfoS.deliveryAddress.deliveryAddress}}
					</view>
				</view>
				<view class="seting-box" @click="goto('/pages/user/profileEdit/index')">
					修改
				</view>
			</view>
			<view class="list-box">
				<view class="item-box">
					<view class="num-box">
						{{userInfoS.point}}
					</view>
					<view class="title-box">
						我的积分
					</view>
				</view>
				<!-- <view class="item-box">
					<view class="num-box">
						0
					</view>
					<view class="title-box">
						20天内过期积分
					</view>
				</view> -->
				<!-- <view class="item-box">
					<view class="num-box">
						0
					</view>
					<view class="title-box">
						待收订单
					</view>
				</view> -->
			</view>
			
		</view>
		<view class="vip-box">
			<view class="vip-item"  @click="goto('/pages/qiandao/index')">
				<!-- <view class="vip-icon">
					图
				</view> -->
				<img src="@/static/user/huiyuanzhongxin.png" alt="" class="vip-icon"/>
				<view class="vip-info">
					<view class="vip-title">
						签到中心
					</view>
					<view class="vip-text">
						领取积分
					</view>
				</view>
				<view class="vip-right">
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view>
			<view class="xian">
				
			</view>
			<view class="vip-item" @click="goto('/pages/user/vip/index')">
				<img src="@/static/user/jifen.png" alt="" class="vip-icon"/>
				<view class="vip-info"> 
					<view class="vip-title">
						会员中心
					</view>
					<view class="vip-text">
						限时特价
					</view>
				</view>
				<view class="vip-right">
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view>
		</view>
		<view class="my-invite">
			<view class="item-box" @click="goto('/pages/user/invite/index')">
				<view class="left">
					<img src="@/static/user/wodeyaoqing.png" alt="" class="my-icon"/>
					<view class="">
						我的邀请
					</view>
				</view>
				
				<view class="right">
					<view class="title">
						邀请好友一起拿奖励
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view>
			<view class="" style="width: 100%;height: 20rpx;background-color: #f7f7f7;">
				
			</view>
			<view class="item-box" @click="goto('/pages/user/oder/index')">
				<view class="left">
					<img src="@/static/user/wodedingdan.png" alt="" class="my-icon"/>
					<view class="">
						我的订单
					</view>
				</view>
				
				<view class="right">
					<view class="title">
						
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view>
			<view class="item-box" @click="goto('/pages/user/address/index')">
				<view class="left">
					<img src="@/static/user/shouhuodizhi.png" alt="" class="my-icon"/>
					<view class="">
						收货地址
					</view>
				</view>
				
				<view class="right">
					<view class="title">
						<!-- 自动获取，不支持修改 -->
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view>
<!-- 			<view class="item-box">
				<view class="left">
					<img src="@/static/user/zhifumima.png" alt="" class="my-icon"/>
					<view class="">
						支付密码
					</view>
				</view>
				
				<view class="right">
					<view class="title">
						
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view> -->
<!-- 			<view class="item-box">
				<view class="left">
					<img src="@/static/user/bangdingshouji.png" alt="" class="my-icon"/>
					<view class="">
						绑定手机
					</view>
				</view>
				
				<view class="right">
					<view class="title">
						
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view> -->
<!-- 			<view class="item-box">
				<view class="left">
					<img src="@/static/user/fuwuzhongxin.png" alt="" class="my-icon"/>
					<view class="">
						服务中心
					</view>
				</view>
				
				<view class="right">
					<view class="title">
						
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view> -->
			<!-- <view class="item-box" @click="goto('/pages/user/feedBack/index')">
				<view class="left">
					<img src="@/static/user/woyaofankui.png" alt="" class="my-icon"/>
					<view class="">
						我要反馈
					</view>
				</view>
				
				<view class="right">
					<view class="title">
					</view>
					<uni-icons type="right" size="10"></uni-icons>
				</view>
			</view> -->
			
		</view>
	</view>
</template>

<script>
	import * as index from '@/api/index.js'
	export default {
		data() {
			return {
				userinfo:{},
				userInfoS:{}
			}
		},
		onLoad() {

		},
		onShow() {
			this.userinfo = uni.getStorageSync('userinfo')
			this.getInfo()
		},
		methods: {
			getInfo() {
				index.getInfo(this.userinfo.userId).then(res=>{
					console.log(res)
					this.userInfoS = res.userInfo
				})
			},
			goto(e) {
				uni.navigateTo({
					url: e
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	
	.info-box {
		width: 750rpx;
		height: 580rpx;
		background: linear-gradient(90deg, #197BE6, #2B9EFB);
		.info-top-box {
			padding-top: 140rpx;
			padding-left: 32rpx;
			padding-right: 32rpx;
			display: flex;
			align-items: center;
			.photo {
				width: 154rpx;
				height: 147rpx;
				border: 4px solid #52B3FF;
				border-radius: 50%;
			}
			.info-text {
				margin-left: 15rpx;
				.name {
					font-weight: bold;
					font-size: 38rpx;
					color: #FFFFFF;
				}
				.addres {
					margin-top: 22rpx;
					font-weight: 500;
					font-size: 25rpx;
					color: #FFFFFF;
				}
			}
			.seting-box {
				margin-left: auto;
			}
		}
		.list-box {
			display: flex;
			align-items: center;
			.item-box {
				margin-top: 36rpx;
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				.num-box {
					font-weight: bold;
					font-size: 38rpx;
					color: #FFFFFF;
				}
				.title-box {
					margin-top: 26rpx;
					font-weight: 500;
					font-size: 26rpx;
					color: #FFFFFF;
				}
			}
		}
		
	}
	.vip-box {
		margin-left: 25rpx;
		// margin-top: 40rpx;
		transform: translateY(-80rpx);
		width: 700rpx;
		height: 142rpx;
		background: #fff;
		box-shadow: 0rpx 1rpx 16rpx 0rpx rgba(6,0,1,0.12);
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		.vip-item {
			padding-left: 37rpx;
			padding-right: 25rpx;
			width: 384rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			.vip-icon {
				width: 59rpx;
				height: 51rpx;
			}
			.vip-info {
				margin-left: 26rpx;
				.vip-title {
					font-weight: 500;
					font-size: 30rpx;
					color: #333333;
				}
				.vip-text {
					font-size: 22rpx;
					color: #FD6500;
				}
			}
			.vip-right {
				margin-left: auto;
				// width: 10rpx;
				// height: 17rpx;
			}
		}
		.xian{
			width: 4rpx;
			height: 70rpx;
			background: #F0F0F0;
		}
	}
	.my-invite {
		background: #FFFFFF;
		transform: translateY(-20px);
		background: #FFFFFF;
		
		.item-box {
			padding: 25rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #e7e7e7;
			.left{
				display: flex;
				align-items: center;
			}
			.right{
				display: flex;
				align-items: center;
				.title{
					margin-right: 20rpx;
					color: #D5D5D5;
				}
			}
			.my-icon{
				height: 33rpx;
				width: 33rpx;
				margin-right: 20rpx;
			}
		}
		
	}
	.my-invite .item-box:first-child{
		border-bottom:none;
	}
</style>